from core.basehandler import BaseHandler
from core.room import Room
from core.support import set_cutscene, get_game
from core.action import Action

class StartingPoint(Room):
    
    def __init__(self, room_id):
        Room.__init__(self, room_id)    # do basic initialization for every room
        
        # build list of actions
        self.add_action(EnterPantry)
        self.add_action(EnterVault)
        self.add_action(EnterComputerRoom)
        self.add_action(EnterLivingQuarters)    
    
    # return description of room.
    def get_description(self):
        return '''
        You are in the center of the Dharma Initiative's Swan Station. Four other rooms are connected.
        '''
    # return image of room
    def get_image(self):
        return 'mainroom.jpg'
         

class StartingPointHandler(BaseHandler):
    
    # return class to use to create a new instance of this room
    def get_room_class(self):
        return StartingPoint

# define actions for this room

#class to get into pantry
class EnterPantry(Action):
    def __init__(self):
        Action.__init__(self, "EnterPantry")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Enter pantry"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'pantry'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"

#class to get into vault
class EnterVault(Action):
    def __init__(self):
        Action.__init__(self, "EnterVault")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Enter vault"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'vault'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"

#class to get into computer room  
class EnterComputerRoom(Action):
    def __init__(self):
        Action.__init__(self, "EnterComputerRoom")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Enter computer room"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'computerroom'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
   
#class to get into living quarters 
class EnterLivingQuarters(Action):
    def __init__(self):
        Action.__init__(self, "EnterLivingQuarters")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Enter living quarters"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'livingquarters'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"